<?php
namespace bee;

/**
 *
 * @author          dzelenika
 * @abstract        Authorisation Authentication Accounting
 *
 */
class aaa implements Iaaa
{

  public $__withEvents        = true;
  use Tsingleton;
  /**
   * @return        aaa
   */
  public static  function getInstance()
  {
    return static::__getInstance();
  }

  protected function __construct()
  {
  	eventDispatcher::getInstance()->registerEvent("authorize", eventDispatcher::EVT_START_REQUEST + 10);
  }

  public function authorize()//$login, $password)
  {
    $username = request::getValue("username", "*");
    $password = request::getValue("password", "*");

    die($username . $password);

  }


  /**
   *
   * @param         int                 $userID
   * @param         string              $form
   * @param         string              $action
   * @return        bool
  */
  public function hasPermission($userID, $form, $action)
  {
  	throw new exception("Function " . __FUNCTION__.  " in class " . __CLASS__ ." not yet implemented", 6969);
  }

  /**
   *
   * @param         string              $login
   * @param         string              $password
   * @return        int
  */
  public function addUser($login, $password)
  {
  	throw new exception("Function " . __FUNCTION__.  " in class " . __CLASS__ ." not yet implemented", 6969);
  }

  /**
   *
   * @param         unknown             $userId
   * @return        bool
   *
  */
  public function deleteUser($userId)
  {
  	throw new exception("Function " . __FUNCTION__.  " in class " . __CLASS__ ." not yet implemented", 6969);
  }

  /**
   *
   * @param         unknown             $userID
   * @param         mixed               $data
   * @return        bool
  */
  public function alterUser($userID, $data)
  {
  	throw new exception("Function " . __FUNCTION__.  " in class " . __CLASS__ ." not yet implemented", 6969);
  }


}